qinglan.Canvas.ParSpread = qinglan.Canvas.Class(function() {

}).methods({

}).statics({
	_init: function(opt, way, data ) {
		var from = qinglan.Extend.simple({}, data.from, 1);
		var map = qinglan.Extend.simple({}, data.map, 1);
		from.theta = opt.start + way * opt.split;
		return {
			from: from,
			map: map
		}
	},
	line: function(opt, way, data) {
		var data = qinglan.Canvas.ParSpread._init(opt, way, data);
		data.map.theta = data.from.theta;
		return {
			from: data.from,
			map: data.map
		}
	},
	assemble: function(opt, way, data) {
		var data = qinglan.Canvas.ParSpread._init(opt, way, data);
		return {
			from: data.from,
			map: data.map
		}
	},
	disperse: function(opt, way, data) {
		var data = qinglan.Canvas.ParSpread._init(opt, way, data);
		var mid = opt.mid;
		way >= mid ? (data.map.theta = opt.end + (way - mid) * opt.split) : (data.map.theta = opt.start - (mid - way) * opt.split);
		return {
			from: data.from,
			map: data.map
		}
	},
	cross: function(opt, way, data ) {
		var data = qinglan.Canvas.ParSpread._init(opt, way, data);
		var mid = opt.mid;
		way >= mid ? (data.map.theta = opt.end - (way - mid) * opt.split) : (data.map.theta = opt.start + (mid - way) * opt.split);
		return {
			from: data.from,
			map: data.map
		}
	},
	vertical: function(opt, way, data) {
		var data = qinglan.Canvas.ParSpread._init(opt, way, data);
		data.from.theta = qinglan.Canvas.Const.deg2rad(90);
		data.map.theta = qinglan.Canvas.Const.deg2rad(90);
		return {
			from: data.from,
			map: data.map
		}
	}
});
